Now let's go through
some common mistakes and understand the best practices to
follow while performing the exercise. Before you do that,
please remember the following points. Microservices an application architecture
that takes every application function and puts it in its own service
isolated from the others. These services are loosely coupled and
independently deployable. Node.js is well suited for microservices
as it is super fast while executing codes. It is highly scalable,
has less buffer time, single threaded event driven and
comes with many asynchronous libraries. Benefits of modern software
development approaches and technologies such as Microservice and
Node.js in app development are as follows. Development is effortless, they're cost
effective and have faster time to market. Node has a built in web server. Updates and maintenance are simple. Their user friendly, it's simple to
install, integrate and maintain. They contain apps with a business focus. Service discovery is how applications and microservices locate
each other on a network. API Gateways provide a shared layer
to handle differences between service protocols and fulfill
the requirements of specific clients such as desktop browsers,
mobile devices and legacy systems. The API Gateway can route requests,
transform protocols, aggregate data and implement shared logic like
authentication and rate limiters. And the API Gateway can be considered as
an entry point to the microservices world. Here are some of the common mistakes
made while performing the exercise, not adding dependencies and all the required dependencies
while implementing code. Using references before creating them, create and initialize all
the references before using them. Not following proper micro
service architecture, implement a proper communication channel
discovery service and API gateway. Using an incorrect uniform
resource identifier or URI, use a correct URI of microservices and
databases. Not following the test case guidelines, all the functionalities are to
be tested through a test case. While avoiding common mistakes, note some of the best practices to
follow while performing the exercise. Use HTTP methods and API routes. Use HTTP status codes correctly. Use HTTP headers to send metadata. Pick the right framework for
your Node.js microservice. Use conditional requests. Organize the files around features. Don't put logic in index.js files. Place your test files next
to the implementation.